package com.ipet.app.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.ipet.app.R;
import com.ipet.app.adapter.ViewHolder.FragmentTwoCenterViewHolder;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;


/**
 * Created by jindongping on 16/3/17.
 */
public class FragmentTwoAdapter extends RecyclerArrayAdapter<String> {


    public final int TYPE_TOP = 1;
    public final int TYPE_CENTER= 2;

    public FragmentTwoAdapter(Context context) {
        super(context);
    }


    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        switch (viewType) {
            case TYPE_TOP:
                return null;
            case TYPE_CENTER:
                return new FragmentTwoCenterViewHolder(parent, R.layout.fragment_main_two_center);
        }
        return new FragmentTwoCenterViewHolder(parent, R.layout.fragment_main_two_center);
    }

    @Override
    public int getViewType(int position) {
        if (position == 1) {
            return TYPE_CENTER;
        }
        return TYPE_CENTER;
    }
}
